<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>添加留言</title>
<link rel="stylesheet" href="css/addArticle.css">
</head>
<body>
	
	<p>
				<lable>用户名:</lable>${selectUserById.u_name}</p>
			<p>
			
			<p>
				<lable>性别:</lable>${selectUserById.u_gender}</p>
			<p>
				<lable>年龄:</lable>${selectUserById.u_age}</p>
			<p>
				<lable>电话号码:</lable>${selectUserById.u_phone }</p>
			<p>
				<lable>电子邮件:</lable>${selectUserById.u_email}</p>
				<p>
				<lable>个人爱好:</lable>${selectUserById.u_hobby}</p>
			<p>
				<lable>个人介绍:</lable>${selectUserById.u_introduction}</p>

	<div>
		<form action="message" method="post" id="message" name="message">
		<input type="hidden" value="${artId }" name="m_touserId"/>
		<%-- <input type="hidden" value="${user.u_id }" name="m_fromuserId"/> --%>
			

<textarea placeholder="你要对他说点什么" name="m_content"  id="m_content"  rows="10" cols="80" >
</textarea>

			
			<input type="submit" id="baocun" class="yes" value="留言">
		</form>
	</div>
	
	<script type="text/javascript" src="js/jquery-1.8.3.js"></script>
	<script type="text/javascript">
		$(function(){
			$("#message").submit(function(){
				var m_touserId = $('input[name="m_touserId"]').val();
				/* var m_fromuserId=$('input[name="m_fromuserId"]').val(); */			
				var m_content =$('textarea[name="m_content"]').val();
				console.log(m_content)
				$.post("con",{
					"m_touserId.u_id":m_touserId,
					"m_content":m_content
				},function(resp){
					alert("留言成功");
					var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
					parent.layer.close(index); //再执行关闭   
				})
				return false;
			});
		});
	</script>
</body>
</html>